package com.example.controller;

import com.example.entity.Department;
import com.example.service.DepartmentService;
import com.example.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/dept")
public class DepartmentController {
    
    @Autowired
    private DepartmentService departmentService;
    
    @GetMapping("/list")
    public Result list() {
        List<Department> list = departmentService.getList();
        return Result.success(list);
    }
} 